Repository navigation
feat(#535): dsh phase 4 — split by destination (last overlay shrinks to loopback) - #544
Conversation
…opback dsh's fetch stack honors proxy envs except an unconditional loopback bypass (LOOPBACK_NO_PROXY), so discovery now splits settings.yaml endpoints by destination: loopback (http OR https) keeps the /bili/ settings rewrite via the persistent DSH_HOME overlay (documented exception); non-loopback https rides CONNECT + cert MITM (host added to the whitelist); non-loopback plain-http rides absolute-form forward-proxy requests via HTTP_PROXY. The child gets HTTPS_PROXY + SSL_CERT_FILE (combined bundle — it replaces the trust store) only when something actually routes through them, so no-custom-provider launches behave exactly as before. Built-in deepseek route stays on DEEPSEEK_BASE_URL. isLoopbackHost helper + tests; banner gains the proxy-env route count.
README (EN+ZH): new 'Injection priority' section near the two compression modes (env > CLI/extension API > generated files; bili never owns user data; legacy overlays left unmigrated) and the dsh one-liner. CONFIGURATION (EN+ZH): redirect table, discovery table and the generated-files section updated for the dsh split, plus the pi/omp and hermes rows/bullets that phases 1-2 left stale (they described the removed PI_CODING_AGENT_DIR / HERMES_HOME overlays).
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-544Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr544.tgz
npm install -g packageThis comment is automatically updated on each push. |
[bot] 🏷 Reviewed PR #544 against master (1502287) — LGTM, verified, ready for merge (merge itself stays with you). What I independently re-verifiedPre-flight (re-run on head a819ed8): Code (src/launcher.ts):
Server-side dependency: absolute-form forward-proxy handling is present in master from #538 (src/server.ts:294-311 — absolute-form request line treated like the MITM wiring: Tests (+129): match the description exactly — split matrix incl. wrapped-value unwrap/dedupe/malformed-skip, Docs (EN+ZH): accurate and consistent with the code. The stale pi/omp rows ( Non-blocking notes
No version bump present, release-flow rules respected. Nothing here touches the request pipeline (server.ts/loop/adapters), so the codex E2E suite isn't triggered by this change. |
… prefix
h.split('.')[0] === '127' also matched hostnames like 127.evil.com.
Tightened to /^127\.\d+\.\d+\.\d+$/ per review; regression cases
added (127.evil.com, 127.abc.def).
#553) Semantic merge onto current master. The fork-predate relax walk (#544/ #575), wire overhead (#470), image floors (#488), side-request isolation (#388) and pi host-usage (#590) all landed after this PR's fork point (09ef208). Resolution: - preflight.ts: char regime (unknownBaseline / estimateCoreMessagesUpper / char-based splitChunks + netting / fitsWindow) grafted onto the multi- range walk; the upper bound also carries the image+wire floors. - server.ts: effectiveTokenCount feeds all three prepare branches; the trigger's tokenCount uses upper+floors only for anonymous zero-baseline sessions; unknown-baseline keeps the loop's fitsWindow judgment, known keeps master's rebuilt-payload re-estimate (#330). - unknown-baseline + nothing-compressible fails fast (PR semantics); known-baseline falls through to preflightCompress so the #330 relax path still runs. - Tests adapted to current master/kernel: fork conversation reshaped for the kernel's minPressureBenefit (5k) band and main-request shape (max_tokens>200) since #388 now routes the old shape to passthrough.
What
Phase 4 of #535 (the last remaining issue item): dsh no longer force-routes all upstreams through the
/bili/settings rewrite. Discovery splitssettings.yamlendpoints by destination, matching dsh's actual fetch behavior:/bili/rewrite via persistentDSH_HOMEoverlay (~/.dsh-bili) — the documented exception: dsh's fetch stack bypasses proxy envs for loopback targets unconditionally (LOOPBACK_NO_PROXY, "the bypass is not optional")HTTPS_PROXY+SSL_CERT_FILE→combined-ca.pem(it replaces dsh's trust store, so system roots must be bundled — same pattern as codex)HTTP_PROXY(server support landed in #538)$DEEPSEEK_BASE_URLwrapBehavioral parity: proxy envs are set only when something actually routes through them — a launch with no non-loopback custom providers produces the same child env as before. Inherited proxy vars are fully stripped from the child (same contract as hermes); dsh's loopback exclusion comes from its built-in policy, so no
NO_PROXYjuggling is needed.Docs (EN+ZH)
PI_CODING_AGENT_DIR/HERMES_HOMEoverlays). All phases are merged now, so the docs finally match the code.Pre-flight
npm run typecheckcleannpm test: 1028/1029 pass — sole failure is the sandbox-onlyresolveClientCommand: codex/claude resolve to themselves(/usr/bin/codexexists in this sandbox; fails on pristine master too)npm run buildOKNew tests:
isLoopbackHostunits; dsh discovery split (loopback→rewrite, https→whitelist, http→env-routes, wrapped-value unwrap, dedupe, malformed skip); runLaunch dsh combined fixture (proxy envs + NO_PROXY strip + MITM-domain capture + overlay rewrites ONLY the loopback line + real home byte-identical); runLaunch dsh no-loopback fixture (noDSH_HOME, patch-only-bilidir).Notes
opencode.json(removed on exit) and the dsh loopback overlay — both documented as last-resort exceptions. FullrefreshOverlayHomeabolition can be revisited once dsh gains a settings-path env or an upstream loopback opt-out.